<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>抽奖管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/wechat/lottery/">砸金蛋现场抽奖</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="lottery" action="${ctx}/wechat/lottery/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>名称 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
		<shiro:hasPermission name="sys:user:edit"><th>所属商家</th></shiro:hasPermission>
		<th>名称</th>
		<th>类型</th><th>中奖率</th><th>数量</th><th>备注</th><shiro:hasPermission name="wechat:lottery:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="lottery">
			<tr>
				<shiro:hasPermission name="sys:user:edit"><td>${lottery.user.name}</td></shiro:hasPermission>
				<td><a href="${ctx}/wechat/lottery/form?id=${lottery.id}">${lottery.name}</a></td>
				<td><c:if test="${lottery.type eq 1}">会员抽奖</c:if> <c:if test="${lottery.type eq 2}">商家抽奖</c:if>   </td>
				<td>${lottery.percent}%</td>
				<td>${lottery.peramount}</td>
				<td>${lottery.remarks}</td>
				<shiro:hasPermission name="wechat:lottery:edit">
				<td>
    				<a class="btn btn-success" href="${ctx}/wechat/lottery/toEggLottery?id=${lottery.id}&lottery.id=${lottery.id}">砸金蛋</a>
    				<a class="btn btn-success" href="${ctx}/wechat/lottery/lottery?id=${lottery.id}&clean=clean&topage=eggs">清除队列</a>
				</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
